class Solution {
public:
    int maxArea(vector<int>& height) {
        int i=0;
        int j=height.size()-1;
        int cur=0;//当前值
        int max=0;//最大值
        while(i<j)
        {
            cur=(j-i)*(height[i]<=height[j]?height[i++]:height[j--]);
            if(cur>max)
                max=cur;
        }
        return max;
    }
};